﻿using HuaWei.Windows.Forms;
using System;
using System.IO;
using System.Runtime.InteropServices;

internal class Class4
{
    private static void smethod()
    {
        try
        {
            Console.WriteLine(smethod1("System"));
        }
        catch (FileNotFoundException exception)
        {
            Console.WriteLine(exception.Message);
        }
    }

    public static string smethod1(string str)
    {
        Struct assemblyInfo = new Struct();
        assemblyInfo.num2 = 0x200;
        assemblyInfo.str = new string('\0', assemblyInfo.num2);
        IAssemblyCache iassemblyCache = null;
        IntPtr ptr = Class3.CreateAssemblyCache(out iassemblyCache, 0);
        if (ptr == IntPtr.Zero)
        {
            ptr = iassemblyCache.QueryAssemblyInfo(1, str, ref assemblyInfo);
            if (ptr != IntPtr.Zero)
            {
                Marshal.ThrowExceptionForHR(ptr.ToInt32());
            }
        }
        else
        {
            Marshal.ThrowExceptionForHR(ptr.ToInt32());
        }
        return assemblyInfo.str;
    }
}

